/*
  Created on Jun 23, 2005
  (C) 2005 
  @author Michael Long

  This program is free software; you can redistribute it and/or
  modify it under the terms of Version 2 of the GNU General Public 
  License.
  
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
  
  You should have received a copy of the GNU Library General Public
  License along with this library; if not, write to the Free
  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

package sxe.core;

import snobject.snBoolean;
import snobject.snObject;
import snobject.snObjectArgList;
import step.EvaluationFailure;
import step.FunctionWrapper;


public class equals extends FunctionWrapper {


	public snObject Call(snObjectArgList argv) throws EvaluationFailure 
	{	
		if(argv.length()<2)
			throw new EvaluationFailure(super.expnode,
					EvaluationFailureReasons.BAD_PARAMETER_COUNT);
		
		for(int i=1;i<argv.length();i++){
			if(!argv.objectAt(i).getXmlMimeType().equals(argv.objectAt(0).getXmlMimeType()))
				return snBoolean.FALSE;
			if(!argv.objectAt(i).getGenericContent().equals(argv.objectAt(0).getGenericContent()))
				return snBoolean.FALSE;
		}
		return snBoolean.TRUE;
	}
}
